// Host:    hq1-rddev-005
// File:    S:\Source\tsc\Logging Library\LogCtl_Submit_Update_Form.js
// Script:  LogCtl_Submit_Update_Form
// Author:  pthompson@serena.com

// -------------------------------------------------------------------------

// Date:       $Date: 2013-09-03 08:03:54 +0000 (Tue, 03 Sep 2013) $
// Revision:   $Revision: 82 $

// -------------------------------------------------------------------------



function SetSeverityHelpText() {
   var str_txt ;

   switch (parseInt(GetFieldValue('Severity','-1'))) {
      case 0 :          str_txt = '(0)   LOG_SEVERITY_NONE    None' ; break ;
      case 1 :     str_txt = '(1)   LOG_SEVERITY_EMERGENCY    Emergency: system is unusable' ; break ;
      case 2 :         str_txt = '(2)   LOG_SEVERITY_ALERT    Alert: action must be taken immediately' ; break ;
      case 3 :      str_txt = '(3)   LOG_SEVERITY_CRITICAL    Critical: critical conditions' ; break ;
      case 4 :         str_txt = '(4)   LOG_SEVERITY_ERROR    Error: error conditions' ; break ;
      case 5 :       str_txt = '(5)   LOG_SEVERITY_WARNING    Warning: warning conditions' ; break ;
      case 6 :        str_txt = '(6)   LOG_SEVERITY_NOTICE    Notice: normal but significant condition' ; break ;
      case 7 : str_txt = '(7)   LOG_SEVERITY_INFORMATIONAL    Informational: informational messages' ; break ;
      case 8 :         str_txt = '(8)   LOG_SEVERITY_DEBUG    Debug: debug-level messages' ; break ;
      // The usual escape mechanism BACKSLASH-APOSTROPHE does not work, even in comments like this.
      default: str_txt = "Can't detect valid integer in Severity field.  Please enter number 0...9" ; break
   }
   SetFieldValue('txt_SeverityHelp',str_txt) ;
}

AddLoadCallback(SetSeverityHelpText);
AddChangeCallback('Severity',SetSeverityHelpText);

